<?php
/**
 * @author jonathan poelen <jonathan.poelen@gmail.com>
 * @version 1.0: jo_link_noir
 * @date 24-10-2009
 */

if(!defined('PHP_VERSION_ID'))
{
    $version = PHP_VERSION;
    define('PHP_VERSION_ID', ($version[0] * 10000 + $version[2] * 100 + $version[4]));
}


if(PHP_VERSION_ID < 50300)
{
	class SW_Exception extends Exception
	{
		/** @var Exception|null*/
		protected $previous;

		/**
		* @param string $message
		* @param int $code = 0
		* @param Exception $previous = NULL
		*/
		public function __construct($message, $code = 0, Exception $previous = null)
		{
			parent::__construct($message, $code);
			$this->previous = $previous;
		}

		/**
		* @return Exception|null
		*/
		final public function getPrevious()
		{
			return $this->previous;
		}
	}
}
else
{
	class SW_Exception extends Exception
	{
	}
}